<%--
    File        : Index
    Created     : 10.6.2014
    Author      : Václav Bukovský
    Description : Main page. This page displays whole database -> all categories with their mediums and information about
    mediums. This page contains basic menu -> people should import data from .ods file, export data to .ods file and
    go to categories, mediums or about page.
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <title>Video library</title>
        <link rel="stylesheet" type="text/css" href="index.css">
    </head>
    <body>

    <h1 id="heading">Project Video Library for PB138 - Spring 2014</h1>

    <!-- Menu -->
    <div class="left">
        <h3>MENU</h3>
        <hr/>
        <h4>LIBRARIES</h4>
        <form method="post" action="<c:url value="/categories"/>" name="categories">
            <input type="submit" value="Categories">
        </form>

        <form method="post" action="<c:url value="/mediums"/>" name="mediums">
            <input type="submit" value="Mediums">
        </form>
        <hr/>
        <h4>IMPORT</h4>
        <form method="post" action="<c:url value="/import"/>" name="import">
            <input type="text" name="pathImport" required/>
            <input type="submit" name="import" value="Import"/>
        </form>
        <h4>EXPORT</h4>
        <form method="post" action="<c:url value="/export"/>" name="export">
            <input type="text" name="pathExport" required/>
            <input type="submit" name="export" value="Export"/>
        </form>
        <c:if test="${not empty imExError}">
            <h4 style="color: red; background-color: black"><c:out value="${imExError}"/></h4>
        </c:if>

        <hr/>

        <form method="post" action="<c:url value="/about.jsp"/>" name="about">
            <input type="submit" value="About">
        </form>

    </div>

    <!-- Main overview -->
    <div class="right">
        <h3 align="center">Database Content</h3>
        <c:if test="${not empty mainList}">
            <c:set var="msg" value="${mainList}" scope="page" />
            <c:out value="${msg}" escapeXml="false" default="Nothing to show!"/>
        </c:if>
    </div>
    </body>
</html>